<html>
<head>
    <title>XBRLAPI installation suggestions</title>
    <link rel="stylesheet" href="/css/styles.css" type="text/css"/>
    <script type="text/javascript">
        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
        document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
        try {
            var pageTracker = _gat._getTracker("UA-11401995-1");
            pageTracker._setDomainName("none");
            pageTracker._setAllowLinker(true);
            pageTracker._trackPageview();
        } catch (err) {
        }</script>
</head>


<body>

<div class="logo_container">
	<span class="logo">
		<a class="title" href="/">XBRLAPI</a>
	</span>
	<span class="logo_subscript">
		<a class="title" href="http://en.wikipedia.org/wiki/Free_and_open_source_software">Free Open-Source Software</a>
	</span>
</div>

<div id="navcontainer">
    <form action="http://www.xbrlapi.org/search.html" id="cse-search-box">
        <div>
            <input type="hidden" name="cx" value="partner-pub-3957505011939955:jqid48zd81o"/>
            <input type="hidden" name="cof" value="FORID:10"/>
            <input type="hidden" name="ie" value="ISO-8859-1"/>
            <input type="text" name="q" size="31"/>
            <input type="submit" name="sa" value="Search"/>
        </div>
    </form>

    <script
            type="text/javascript"
            src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en">
    </script>

    <ul id="navlist">
        <li><a href="/">Home</a></li>
        <li><a href="testConfigurationFile.html">Configuration Properties</a></li>
    </ul>

    <script type="text/javascript"><!--
    google_ad_client = "pub-3957505011939955";
    /* XBRLAPI site */
    google_ad_slot = "4927123290";
    google_ad_width = 160;
    google_ad_height = 600;
    //-->
    </script>
    <script type="text/javascript"
            src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>

</div>

<div class="content">
    <h1>
        Using the XBRLAPI from the command line
    </h1>

    <h2>
        Overview
    </h2>

    <p>This page is relevant to those looking to perform some basic command line
        tests that XBRLAPI is available from their commandline.</p>

    <h2>Get Java on the command line</h2>

    <p>Type <code>java -version</code> at the command line to see if Java is available.
        You should see a message indicating that the java version is 1.6 or later. See the
        <a href="java.html">Java configuration</a> page if you run into troubles.</p>

    <h2>Get the necessary JAR files</h2>

    <p>Ensure that the XBRLAPI JAR files are on the class path. This can be done by
        placing them in the lib/ext directory in the Java installation. It can also be done
        by modifying the CLASS_PATH environment variable to include the directory that contains
        the XBRLAPI JAR files. It can also be done by ensuring that the current directory for the
        command line operations also contains the XBRLAPI JAR files.</p>

    <p>At a minimum you will need:</p>
    <ul>
        <li>xbrlapi-utilities-VERSION.jar</li>
        <li>xbrlapi-api-VERSION.jar</li>
        <li>xmlbase-api-VERSION.jar</li>
        <li>xlink-api-VERSION.jar</li>
        <li>xpointer-api-VERSION.jar</li>
    </ul>

    <p>where VERSION is the XBRLAPI release VERSION.</p>

    <p>Alternatively you can just get the xbrlapi-VERSION.jar file and use it. It
        contains all the other modules in a single JAR for convenience.</p>

    <p>Download the necessary XBRLAPI modules as JAR files from
        <a href="https://sourceforge.net/project/showfiles.php?group_id=135539">Sourceforge</a>.
        You will definitely require the xbrlapi-utilities module, the
        xbrlapi-api module, the xbrlapi-xlink, xbrlapi-xpointer and
        xbrlapi-xmlbase modules. If you want to use a persistent data store,
        then you will also require one of the xbrlapi-bdb-xml or xbrlapi-exist modules.</p>

    <p>
        You can also download the latest snapshot of the API from
        <a href="http://xbrlapi.svn.sourceforge.net/viewvc/xbrlapi/trunk/dist/">the SVN repository.</a>
        This is generally not broken (in the sense that that unit tests pass) but neither will it be stable.
    </p>

    <p>You will also need a number of third party JAR files.</p>

    <p>To make things easy, these have been included in the SVN repository for the XBRLAPI so
        if you check out the XBRLAPI project from SVN then you should have them all. Alternatively
        you can download those that you require directly from the
        <a href="http://xbrlapi.svn.sourceforge.net/viewvc/xbrlapi/trunk/java/lib/">browseable SVN repository</a>.</p>

    <p>Look in the <a href="maven.html">Maven POM files</a> to determine which third party JARs you need.</p>

    <h2>Put the JAR files on your CLASS_PATH</h2>

    <p>Make sure that all of the necessary JAR files (the XBRLAPI ones and the third party
        dependency ones) are on your Java CLASS_PATH. If you have installed a complete Java SDK,
        then a very simple way to achieve this outcome is to place them in your $JAVA_HOME/jre/lib/ext
        directory where $JAVA_HOME is the value of the JAVA_HOME environment variable
        set when you installed your Java SDK. If you are identifying the necessary JAR files
        using the -classpath parameter, then be sure not to also use the -jar parameter for the Java
        runtime engine.</p>

    <h2>Configure log4j</h2>

    <p>You need to configure <a href="http://logging.apache.org/log4j/docs/download.html">log4j</a>.
        This configuration is specified in an XML file. A useful starting point for such
        <a href="http://xbrlapi.svn.sourceforge.net/viewvc/xbrlapi/trunk/conf/log4j.xml?view=log">a
            log4j configuration</a> is available from the online SVN browsing facility at Sourceforge. Download
        the log4j.xml file and its DTD (or if you have checked out the entire XBRLAPI project, then just use the
        log4.xml
        file that is in the <code>conf</code> directory of the XBRLAPI project) and store it somewhere
        convenient, say <code>/configuration/file/path/log4j.xml</code>. This configuration file
        is set up to send log messages to the console.</p>

    <h2>Configure your local cache for XBRL documents</h2>

    <p>The XBRLAPI caches any documents that are loaded into a data store. You need to set
        up a writeable folder to store this cache. When populated, the cache will contain a local
        copy of each of the XML documents that are discovered during the loading process.
        Refer to the directory where the local copies are to be cached as:
        <code>/xbrl/cache/</code></p>

    <p>
        At this point you have just about enough basic configuration to run your own programs using
        the XBRLAPI from the commandline. There are a few specific commandline programs with more detailed
        documentation in the <a href="/examples">examples</a> on this website.
    </p>

    <h2>Running the Unit tests distributed with XBRLAPI</h2>

    <p>A more comprehensive test of your XBRLAPI installation is possible <a href="unitTesting.html">using the
        TestNG tests</a> that are distributed with XBRLAPI.</p>

    <p>
        <a href="http://sourceforge.net/projects/xbrlapi"><img
                src="http://sflogo.sourceforge.net/sflogo.php?group_id=135539&type=11" width="120" height="30"
                border="0"
                alt="Get Java XBRL API implementation at SourceForge.net. Fast, secure and Free Open Source software downloads"/></a>
    </p>

</div>

</body>
</html>
